home *** CD-ROM | disk | FTP | other *** search
/ Aminet 28 / Aminet 28 (1998)(GTI - Schatztruhe)[!][Dec 1998].iso / Aminet / util / rexx / tocopy.lha / ToCopy.rexx < prev   
Encoding:
OS/2 REXX Batch file  |  1998-07-27  |  1.6 KB  |  83 lines

  1. /* Title    ToCopy                        */
  2. /* Author   Paul Clough                   */
  3. /* version  1.1                           */
  4. /* date     29/06/98                      */
  5. /* lastdate 26/07/98                      */
  6. /* Email    ca5pcl@isis.sunderland.ac.uk  */
  7.  
  8.  
  9. /* Do with result in Opus Directory variable pass to my rexx programme */
  10. options results
  11.  
  12. /* Pass PortName of direcotry Opus as argrument */
  13.  
  14. Parse arg PortName
  15.  
  16. /* Test see if port is active */
  17. IF show('P',PortName) then 
  18.  Do
  19.  /* tell send line or chars to finnal copy at current cursor location */
  20.  address(PortName)
  21.  
  22.  /* get active window */
  23.  status 3 -1
  24.  win=result
  25.  
  26.  
  27.  /* entries in the directory window */
  28.  
  29.  status 6 win
  30.  entries=result
  31.  
  32.  /* selected entries in the directory window */
  33.  status 9 win
  34.  selentries=result
  35.  
  36.  if selentries=entries then
  37.   Do
  38.     /* returns the name of the directory (Source) */
  39.     status 13 win
  40.     sourpath=result
  41.  
  42.     /* de-highligh marks files  */
  43.     None
  44.  
  45.     /* Switch to other window in opus 4.12 */
  46.     OtherWindow
  47.  
  48.     status 3 -1
  49.     win=result
  50.  
  51.     /* returns the name of the directory (destination) */
  52.     status 13 win
  53.     destpath=result
  54.  
  55.     /* Do with wild card and spaces */
  56.     sourpath='"'sourpath'#?"'
  57.     destpath='"'destpath'"'
  58.     say(sourpath'----'destpath)
  59.  
  60.     /* Use Dos command copy to duplicate files free up opus */
  61.     address command 
  62.     copy sourpath destpath ALL
  63.  
  64.     /* Rescan destory directory */
  65.     address (PortName)
  66.     Rescan
  67.   End
  68.  else
  69.   Do
  70.     /* Use internal Opus copy command  */
  71.     Copy
  72.   End
  73.  End
  74. else
  75.  Do
  76.  /* Print up a error message */
  77.   say ('Dopus directory not in memory')
  78.  End
  79.  
  80.  
  81. say(result)
  82.  
  83.